package com.dwxt.sport.dao;

import com.dwxt.sport.entity.RunRecord;
import com.dwxt.sport.entity.RunRecordExample;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface RunRecordMapper {
    long countByExample(RunRecordExample example);

    int deleteByExample(RunRecordExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(RunRecord record);

    int insertSelective(RunRecord record);

    List<RunRecord> selectByExample(RunRecordExample example);

    RunRecord selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") RunRecord record, @Param("example") RunRecordExample example);

    int updateByExample(@Param("record") RunRecord record, @Param("example") RunRecordExample example);

    int updateByPrimaryKeySelective(RunRecord record);

    int updateByPrimaryKey(RunRecord record);

    Integer selectMeMonthRank(@Param("year")int year, @Param("month")int month, @Param("userId")String userId);

    List<Map<String, Object>> select10AllRunRecords();

    Integer selectMeAllRank(String currentUserId);

    RunRecord selectMonthRunRecord(@Param("userId") String userId, @Param("year") Integer year, @Param("month") Integer month);

    List<RunRecord> get10MonthRunRecords(@Param("year") int year, @Param("month") int month);
}